Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precomputing tier odds #35

Merged
merged 5 commits into from
Jun 29, 2023
Merged

Precomputing tier odds #35

merged 5 commits into from
Jun 29, 2023

Conversation

dylandesrosier
Copy link
Contributor

No description provided.


}
SD59x18 internal immutable TIER_ODDS_0_3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier odds will always be less than 0 <= 1, so you can use the 64-bit SD1x18.

This should save gas

revert InvalidTier(_tier, _numberOfTiers);
}

tierOdds = TieredLiquidityDistributor._tierOdds(_tier, numberOfTiers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this written so strangely with the Superclass qualifier?

startTimestamp = uint64(
endTimestamp -
TierCalculationLib.estimatePrizeFrequencyInDraws(
TieredLiquidityDistributor._tierOdds(_tier, numberOfTiers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funny syntax? isn't it just an internal fxn?

@dylandesrosier dylandesrosier merged commit b507fdc into main Jun 29, 2023
0 of 2 checks passed
@dylandesrosier dylandesrosier deleted the precomputing-tier-odds branch June 29, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants